// base
import Taro, { Component } from '@tarojs/taro'
import { View } from '@tarojs/components'
// less
import './index.less'
import If from '../../../../components/page-components/if'
import ShowEmpty from '../../../../components/page-components/show-empty'
import JobsList from '../../../../components/page-components/jobs-list'
import BottomLoading from '../../../../components/page-components/bottom-loading'
import TopLoading from '../../../../components/page-components/top-loading'

class JobsScrollWrap extends Component {
  render () {
    const { dataSource = [], landmarkName, role, companyId, requestOverTop, barlevecurrent } = this.props
    return (
      <View className="JobsScrollWrap_id76833">
        <If visible={!requestOverTop}>
          <TopLoading />
        </If>
        <If
          visible={requestOverTop && dataSource && !dataSource.showLeftEmpty}
          renderElse={<ShowEmpty />}
        >
          <JobsList
            dataSource={dataSource.dataSource}
            companyId={companyId}
            role={role}
            landmarkName={landmarkName}
            barlevecurrent={barlevecurrent}
          />
          <BottomLoading haveNext={dataSource.haveNextJobPage} />
        </If>
      </View>
    )
  }
}

export default JobsScrollWrap
